package one.stand.controller;

import one.stand.model.ResultModel;
import one.stand.request.FinanceRequest;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 公司财务/销售
 * @author Administrator
 */
@RequestMapping("finance")
@RestController
public class FinanceController extends BaseController {

    /**
     * 公司财务统计-总收入
     *
     * @param request
     * @return
     */
    @PostMapping("/getGrossIncome")
    public ResultModel getGrossIncome(@RequestBody FinanceRequest request) {
        return financeService.getGrossIncome(request);
    }

    /**
     * 公司财务统计-商城流水
     *
     * @param request
     * @return
     */
    @PostMapping("/selectFinanceMall")
    public ResultModel<Map<String, Object>> selectFinanceMall(@RequestBody FinanceRequest request) {
        return financeService.selectFinanceMall(request);
    }

    /**
     * 公司财务统计-成交流水
     *
     * @param request
     * @return
     */
    @PostMapping("/selectFinanceDeal")
    public ResultModel<Map<String, Object>> selectFinanceDeal(@RequestBody FinanceRequest request) {
        return financeService.selectFinanceDeal(request);
    }

    /**
     * 公司财务统计-公司流水
     *
     * @param request
     * @return
     */
    @PostMapping("/selectFinanceCompany")
    public ResultModel<Map<String, Object>> selectFinanceCompany(@RequestBody FinanceRequest request) {
        return financeService.selectFinanceCompany(request);
    }

    /**
     * 公司销售排行-客户人数
     *
     * @param request
     * @return
     */
    @PostMapping("/selectCustomerNum")
    public ResultModel<Map<String, Object>> selectCustomerNum(@RequestBody FinanceRequest request) {
        return financeService.selectCustomerNum(request);
    }

    /**
     * 公司销售排行-订单量
     *
     * @param request
     * @return
     */
    @PostMapping("/selectOrderNum")
    public ResultModel<Map<String, Object>> selectOrderNum(@RequestBody FinanceRequest request) {
        return financeService.selectOrderNum(request);
    }

    /**
     * 公司销售排行-互动频率
     *
     * @param request
     * @return
     */
    @PostMapping("/selectInteractionNum")
    public ResultModel<Map<String, Object>> selectInteractionNum(@RequestBody FinanceRequest request) {
        return financeService.selectInteractionNum(request);
    }

    /**
     * 公司销售排行-成交率区间
     *
     * @param request
     * @return
     */
    @PostMapping("/selectDelNum")
    public ResultModel<Map<String, Object>> selectDelNum(@RequestBody FinanceRequest request) {
        return financeService.selectDelNum(request);
    }

}
